{% extends "learning_logs/base.html" %}
{% load bootstrap3 %}

{% block header %}
    <h1>{{ topic }}</h1>

{% endblock header %}

{% block content %}

<p>
    <h2>
         <a href="{% url 'learning_logs:new_entry' topic.id %}">添加新条目</a>
    </h2>

</p>
<ul>
{% for entry in entries %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3>
                <small>
                    {{ entry.date_added|date:'M d,Y H:i' }}

                    <a href="{% url 'learning_logs:edit_entry' entry.id %}">编辑条目</a>
                </small>
            </h3>
        </div>

        <div class="panel-body">
              {{ entry.text|linebreaks }}
        </div>
    </div>


    {% empty %}
        没有创建任何条目

{% endfor %}
</ul>


{% endblock content %}
